import KZJRequest from '../index'
import { TRequestDefaultResult } from '../type'

enum Singer {
  Brief = '/artists', // 歌手简介
  Album = '/artist/album', // 专辑数据
  AlbumAll = '/album', // 专辑歌曲
  Mvs = '/artist/mv', // 歌手Mv
  Detail = '/artist/desc', // 歌手详情介绍
  Simi = '/simi/artist' // 相似歌手
}

export function getSingerBrief(id: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Brief,
    params: { id },
    showLoading: true
  })
}

export function getSingerAlbum(id: number, limit = 30, offset = 0) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Album,
    params: { id, limit, offset },
    showLoading: true
  })
}

export function getSingerAlbumAll(id: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.AlbumAll,
    params: { id },
    showLoading: true
  })
}

export function getSingerMv(id: number, offset: number, limit = 20) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Mvs,
    params: { id, offset, limit },
    showLoading: true
  })
}

export function getSingerDetail(id: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Detail,
    params: { id },
    showLoading: true
  })
}

export function getSingerSimi(id: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Simi,
    params: { id },
    showLoading: true
  })
}
